home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / ddx / sprite.X11R3 / hdr / mem_rop_impl_util.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-03  |  1.2 KB  |  62 lines

  1. /* @(#)mem_rop_impl_util.h 1.6 89/04/28 SMI */
  2.  
  3. /*
  4.  * Copyright 1986, 1987 by Sun Microsystems,  Inc.
  5.  */
  6.  
  7. #ifndef    mem_rop_impl_util_DEFINED
  8. #define    mem_rop_impl_util_DEFINED
  9.  
  10. /*
  11.  * Utility macros for memory pixrect code
  12.  */
  13.  
  14. /* 
  15.  * Code selection macros 
  16.  */
  17. #define    IFTRUET(t, a, b)    _STMT(if (t) {a;} else {b;})
  18. #define    IFFALSET(t, a, b)    _STMT(b;)
  19.  
  20. /*
  21.  * Option control macros
  22.  */
  23. #define ALWAYS(option,a,b)    IFTRUE(a,b)
  24. #define NEVER(option,a,b)    IFFALSE(a,b)
  25. #define OPTION(option,a,b)    option(a,b)
  26.  
  27. #define    ALWAYST(option,t,a,b)    IFTRUET(t,a,b)
  28. #define    NEVERT(option,t,a,b)    IFFALSET(t,a,b)
  29. #define    OPTIONT(option,t,a,b)    option(t,a,b)
  30.  
  31. /*
  32.  * Speed choice macros
  33.  *
  34.  * The T form is used when the "never" half of the fast code
  35.  * is the same as the slow code.
  36.  *
  37.  * Define NEVER_SLOW to get all fast code.
  38.  * Define NEVER_FAST to get all slow code.
  39.  */
  40.  
  41. #if defined(NEVER_FAST) && !defined(NEVER_SLOW)
  42. #define    FAST    IFFALSE
  43. #define    FASTT    IFFALSET
  44. #else
  45. #define    FAST    IFTRUE
  46. #define    FASTT    IFTRUET
  47. #endif
  48.  
  49. #ifdef NEVER_SLOW
  50. #define    SLOW    IFTRUE
  51. #define    SLOWT    IFTRUET
  52. #else
  53. #define    SLOW    IFFALSE
  54. #define    SLOWT    IFFALSET
  55. #endif
  56.  
  57. /* fast in user, slow in kernel */
  58. #define UFAST IFKERNEL(SLOW,FAST)
  59. #define UFASTT IFKERNEL(SLOWT,FASTT)
  60.  
  61. #endif    mem_rop_impl_util_DEFINED
  62.